package com.laosg.spring.small.core02.beans;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>description: some thing </p>
 *
 * @author kevin
 * @date 8/22/21
 */
public class PropertyValues {
    private final List<PropertyValue> propertyValueList=new ArrayList<>();

    public void addpropertyValue(PropertyValue propertyValue) {
        this.propertyValueList.add(propertyValue);
    }

    public PropertyValue[] getPropertyValues() {
        return this.propertyValueList.toArray(new PropertyValue[0]);
    }

    public PropertyValue getPropertyValue(String propertyName) {
        return propertyValueList.stream().filter(d->d.getName().equals(propertyName))
                .findFirst().get();
    }



}
